﻿using Entity;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAL
{
    public class Data_Schedule : Data
    {
        #region[Schedule_Insert]
        public void Schedule_Insert(Schedule data)
        {
            using (SqlCommand cmd = new SqlCommand("sp_Schedule_Insert", GetConnection()))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("@Schedule_ID",GetConnection());
                cmd.Parameters.Add("@Date",GetConnection());
                cmd.Parameters.Add("@Time",GetConnection());

                cmd.ExecuteNonQuery();
            }
        }
        #endregion

        #region[Schedule_GetByAll]
        public DataTable Schedule_GetByAll()
        {
            using (SqlCommand cmd = new SqlCommand("sp_Schedule_GetByAll", GetConnection()))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                DataTable dt = new DataTable();
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                da.Fill(dt);

                return dt;
            }
        }
        #endregion
    }
}
